home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 22 / AACD 22.iso / AACD / Programming / powerd / modules.lha / modules / graphics / gfxmacros.m < prev    next >
Encoding:
Text File  |  2000-06-03  |  1.4 KB  |  47 lines

  1. MODULE    'graphics/rastport'
  2.  
  3. #define ON_DISPLAY    custom.dmacon:=BITSET|DMAF_RASTER
  4. #define OFF_DISPLAY    custom.dmacon:=BITCLR|DMAF_RASTER
  5. #define ON_SPRITE        custom.dmacon:=BITSET|DMAF_SPRITE
  6. #define OFF_SPRITE    custom.dmacon:=BITCLR|DMAF_SPRITE
  7.  
  8. #define ON_VBLANK        custom.intena:=BITSET|INTF_VERTB
  9. #define OFF_VBLANK    custom.intena:=BITCLR|INTF_VERTB
  10.  
  11. #define SetDrPt(w,p)        (w).LinePtrn:=p\
  12.                                 (w).Flags|=FRST_DOT\
  13.                                 (w).linpatcnt:=15
  14. #define SetAfPt(w,p,n)    (w).AreaPtrn:=p\
  15.                                 (w).AreaPtSz:=n
  16.  
  17. #define SetOPen(w,c)        (w).AOlPen:=c\
  18.                                 (w).Flags|=AREAOUTLINE
  19. #define SetWrMsk(w,m)    (w).Mask:=m
  20.  
  21. /* the SafeSetxxx macros are backwards (pre V39 graphics) compatible versions */
  22. /* using these macros will make your code do the right thing under V39 AND V37 */
  23. #define SafeSetOutlinePen(w,c)\
  24.     IF GfxBase.LibNode.Version<39\
  25.         (w).AOlPen:=c\
  26.         (w).Flags|=AREAOUTLINE\
  27.     ELSE SetOutlinePen(w,c)
  28. #define SafeSetWriteMask(w,m)\
  29.     IF GfxBase.LibNode.Version<39\
  30.         (w).Mask:=(m)\
  31.     ELSE SetWriteMask(w,m)
  32.  
  33. /* synonym for GetOPen for consistency with SetOutlinePen */
  34. // #define GetOutlinePen(rp) GetOPen(rp)
  35.  
  36. #define BNDRYOFF(w)    (w).Flags&=~AREAOUTLINE
  37.  
  38. #define CINIT(c,n)    UCopperListInit(c,n)
  39. #define CMOVE(c,a,b)    CMove(c,&a,b)\
  40.                             CBump(c)
  41. #define CWAIT(c,a,b)    CWait(c,a,b)\
  42.                             CBump(c)
  43. #define CEND(c)        CWAIT(c,10000,255)
  44.  
  45. #define DrawCircle(rp,cx,cy,r)    DrawEllipse(rp,cx,cy,r,r);
  46. #define AreaCircle(rp,cx,cy,r)    AreaEllipse(rp,cx,cy,r,r);
  47.